package com.hcj.admin.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.hcj.admin.entity.TPermission;
import com.hcj.admin.entity.TPermissionVo;
import com.hcj.admin.mapper.TPermissionMapper;
import com.hcj.admin.service.ITPermissionService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 权限表 服务实现类
 * </p>
 *
 * @author HuangChangjin
 * @since 2017-10-23
 */
@Service
public class TPermissionServiceImpl extends ServiceImpl<TPermissionMapper, TPermission> implements ITPermissionService {

    @Override
    public List<TPermission> getByUserId(String id) {
        return baseMapper.getByUserId(new EntityWrapper<TPermission>().where("u.id = {0} and p.id is not null", id));
    }

    @Override
    public TPermissionVo get(String id) {
        return baseMapper.get(id);
    }
}
